<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>usbpsu: xusb_wrapper.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">usbpsu
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xusb__wrapper_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xusb_wrapper.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains implementation of USBPSU Driver wrappers. </p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who       Date     Changes
</p>
<hr/>
<p>
1.0   BK        12/01/18 First release
      MYK       12/01/18 Added hibernation support for device mode
      vak       13/03/18 Moved the setup interrupt system calls from driver to
                 example.
1.5      vak    02/06/19 Modified the code to add UsbPollHandler and
                 UsbEnableEvent API's
      vak       02/07/19 Modified the code to issue <a class="el" href="group__usbpsu__api.html#ga78d9a929bbb9036e7eb4ba85b176df0d" title="Stalls control endpoint and restarts to receive setup packet. ">XUsbPsu_Ep0StallRestart()</a>
                 for Endpoint Zero
1.14  pm     21/06/23 Added support for system device-tree flow.</pre><pre></pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a1c387f7a6cc0e39d1adaaff2d1fd1f00"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__wrapper_8c.html#a1c387f7a6cc0e39d1adaaff2d1fd1f00">UsbPollHandler</a> (struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *InstancePtr)</td></tr>
<tr class="memdesc:a1c387f7a6cc0e39d1adaaff2d1fd1f00"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handler called from polled mode for handling usb events.  <a href="#a1c387f7a6cc0e39d1adaaff2d1fd1f00">More...</a><br/></td></tr>
<tr class="separator:a1c387f7a6cc0e39d1adaaff2d1fd1f00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af81f75ebda88cd593c5619754286e4ae"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__wrapper_8c.html#af81f75ebda88cd593c5619754286e4ae">UsbEnableEvent</a> (struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *InstancePtr, u32 Mask)</td></tr>
<tr class="memdesc:af81f75ebda88cd593c5619754286e4ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the events specified in the mask.  <a href="#af81f75ebda88cd593c5619754286e4ae">More...</a><br/></td></tr>
<tr class="separator:af81f75ebda88cd593c5619754286e4ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02e8ef492f6fb18133f23f90205cc573"><td class="memItemLeft" align="right" valign="top">s32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__wrapper_8c.html#a02e8ef492f6fb18133f23f90205cc573">IsSuperSpeed</a> (struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *InstancePtr)</td></tr>
<tr class="memdesc:a02e8ef492f6fb18133f23f90205cc573"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets speed of the Core for connecting to Host.  <a href="#a02e8ef492f6fb18133f23f90205cc573">More...</a><br/></td></tr>
<tr class="separator:a02e8ef492f6fb18133f23f90205cc573"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a806fa9a72091f47fa04844f988166e70"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__wrapper_8c.html#a806fa9a72091f47fa04844f988166e70">SetConfigDone</a> (void *InstancePtr, u8 Flag)</td></tr>
<tr class="memdesc:a806fa9a72091f47fa04844f988166e70"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the Config state.  <a href="#a806fa9a72091f47fa04844f988166e70">More...</a><br/></td></tr>
<tr class="separator:a806fa9a72091f47fa04844f988166e70"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a30882c23a359d37202d4096f8e278a69"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__wrapper_8c.html#a30882c23a359d37202d4096f8e278a69">GetConfigDone</a> (void *InstancePtr)</td></tr>
<tr class="memdesc:a30882c23a359d37202d4096f8e278a69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the Config state.  <a href="#a30882c23a359d37202d4096f8e278a69">More...</a><br/></td></tr>
<tr class="separator:a30882c23a359d37202d4096f8e278a69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab30ae0bb64c54e1ab61239c495a453d3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__wrapper_8c.html#ab30ae0bb64c54e1ab61239c495a453d3">SetEpInterval</a> (void *InstancePtr, u8 UsbEpNum, u8 Dir, u32 Interval)</td></tr>
<tr class="memdesc:ab30ae0bb64c54e1ab61239c495a453d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sets Endpoint Interval.  <a href="#ab30ae0bb64c54e1ab61239c495a453d3">More...</a><br/></td></tr>
<tr class="separator:ab30ae0bb64c54e1ab61239c495a453d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a30882c23a359d37202d4096f8e278a69"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 GetConfigDone </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the Config state. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a private member of <a class="el" href="struct_usb___dev_data.html" title="struct Usb_DevData - Application device data Application Data ">Usb_DevData</a> instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Current configuration value</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_usb_psu.html#a08f67def1d92b23c1988c830f4d8b83f">XUsbPsu::IsConfigDone</a>.</p>

</div>
</div>
<a class="anchor" id="a02e8ef492f6fb18133f23f90205cc573"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">s32 IsSuperSpeed </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_usb___dev_data.html">Usb_DevData</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets speed of the Core for connecting to Host. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_usb___dev_data.html" title="struct Usb_DevData - Application device data Application Data ">Usb_DevData</a> instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS else XST_FAILURE</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_usb___dev_data.html#a35624c7f1dbe7a05bd61f4abf44d5cd8">Usb_DevData::PrivateData</a>, and <a class="el" href="group__usbpsu__api.html#ga7e0a64e9adf5e221b4bd8386ad38055e">XUsbPsu_IsSuperSpeed()</a>.</p>

<p>Referenced by <a class="el" href="xusb__freertos__class__composite_8h.html#a787b860ced36f781523ab445c3f0f1e9">ParseCBW()</a>, <a class="el" href="xusb__freertos__ch9__storage_8h.html#a5f71c81f47255ca655c3fe4262b97b68">Usb_Ch9SetupCfgDescReply()</a>, <a class="el" href="xusb__freertos__ch9__storage_8h.html#a8eaa9363a2026b377cee0a09377f6420">Usb_Ch9SetupDevDescReply()</a>, and <a class="el" href="xusb__freertos__ch9__storage_8h.html#a36f6da36a86aeccc3ffd45b8d20b72c2">Usb_Ch9SetupStrDescReply()</a>.</p>

</div>
</div>
<a class="anchor" id="a806fa9a72091f47fa04844f988166e70"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SetConfigDone </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Flag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the Config state. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a private member of <a class="el" href="struct_usb___dev_data.html" title="struct Usb_DevData - Application device data Application Data ">Usb_DevData</a> instance. </td></tr>
    <tr><td class="paramname">Flag</td><td>is the config value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xusb__freertos__ch9__storage_8h.html#af99800b04544fe0bfa385de154d79087">Usb_SetConfiguration()</a>, and <a class="el" href="xusb__freertos__ch9__storage_8h.html#a4e6a99c41d5f094f189a0d4c0ad8b58b">Usb_SetConfigurationApp()</a>.</p>

</div>
</div>
<a class="anchor" id="ab30ae0bb64c54e1ab61239c495a453d3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SetEpInterval </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>UsbEpNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>Dir</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Interval</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sets Endpoint Interval. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a private member of <a class="el" href="struct_usb___dev_data.html" title="struct Usb_DevData - Application device data Application Data ">Usb_DevData</a> instance. </td></tr>
    <tr><td class="paramname">UsbEpnum</td><td>is Endpoint Number. </td></tr>
    <tr><td class="paramname">Dir</td><td>is Endpoint Direction(In/Out). </td></tr>
    <tr><td class="paramname">Interval</td><td>is the data transfer service interval</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_usb_psu___ep.html#a0f79403cf89a048aeedf9be9a9da8f4f">XUsbPsu_Ep::Interval</a>.</p>

<p>Referenced by <a class="el" href="xusb__freertos__class__composite_8h.html#a43a401c19d0503aa6f48746b3cb11721">prvPlayBackTask()</a>, <a class="el" href="xusb__freertos__class__composite_8h.html#a3b7cf32bf38cd19d9b38c52b52ebd9c4">prvRecordTask()</a>, and <a class="el" href="xusb__freertos__class__composite_8h.html#acd0aa2711cb840f03df965a2c16dfebf">Usb_SetIntf()</a>.</p>

</div>
</div>
<a class="anchor" id="af81f75ebda88cd593c5619754286e4ae"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void UsbEnableEvent </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>Mask</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables the events specified in the mask. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_usb_psu.html" title="USB Device Controller representation USB Device Controller representation. ">XUsbPsu</a> instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="group__usbpsu__api.html#ga48e6e534c10a7a99be5606a0583c2129">XUsbPsu_EnableIntr()</a>.</p>

<p>Referenced by <a class="el" href="xusb__poll__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a1c387f7a6cc0e39d1adaaff2d1fd1f00"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void UsbPollHandler </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="struct_x_usb_psu.html">XUsbPsu</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Handler called from polled mode for handling usb events. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_usb_psu.html" title="USB Device Controller representation USB Device Controller representation. ">XUsbPsu</a> instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="group__usbpsu__api.html#ga9b106790d1b007e134bda766af314a9a">XUsbPsu_IntrHandler()</a>.</p>

<p>Referenced by <a class="el" href="xusb__poll__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
